<?php


namespace app\logic\traits;


use think\facade\Db;
use XCX\wechat\WxPay;
use app\api\common;
trait OrderPay
{
    public function getPayParam($order){
        global $user;
        $setting=Db::name("wxapp")->where("id",1)->find();
        $_wxPay=new WxPay($setting);
        $_openid=$user['openid'];
        if($user['unionid']=='oP16M5zXDL369VwXwcLhAPkxjIE8'){
        	//var_dump($_openid,125789);exit;
        }
        $params=array(
            'title'=>'艺术作品订单',
            'tid'=>$order['ordersn'],
            'free'=>$order['price'],
            'openid'=>$_openid,
        );
        return $_wxPay->weixin_pay($params,20);
    }
}